package Book;

public class BookShelf {
    //用数组来表示书架
    private Book[] books=new Book[10];
    private int num;//表示实际的书的个数

    public BookShelf(){
        this.books[0]=new Book("三国演义","罗贯中",19,"小说");
        this.books[1]=new Book("西游记","施耐庵",75,"小说");
        this.books[2]=new Book("红楼梦","曹雪芹",52,"小说");

        this.num=3;
    }

    public Book getBook(int pos) {
        return books[pos];
    }

    public void setBooks(int pos,Book book) {
        this.books[pos] = book;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }
    //获取整个数组
    public Book[] getBooks(){
        return books;
    }
}
